import request from '@/utils/request'

// 查询能源站信息列表
export function  stationInfoDict() {
  return request({
    url: '/greenCertificate/certificate/dict',
    method: 'get',
  })
}

// 查询能源站信息列表
export function listStationInfo(query) {
  return request({
    url: '/station/stationInfo/list',
    method: 'get',
    params: query
  })
}

// 查询能源站信息详细
export function getStationInfo(stationId) {
  return request({
    url: '/station/stationInfo/' + stationId,
    method: 'get'
  })
}
export function selectStationInfoAndDeviceById(stationId) {
  return request({
    url: '/station/stationInfo/deviceReal/' + stationId,
    method: 'get'
  })
}
export function selectStationAndDeviceByIdDeviceType(stationId,deviceType) {
  return request({
    url: '/station/stationInfo/deviceRealByType',
    method: 'get',
    params: {stationId:stationId,deviceType:deviceType}
  })
}

// 新增能源站信息
export function addStationInfo(data) {
  return request({
    url: '/station/stationInfo',
    method: 'post',
    data: data
  })
}

// 修改能源站信息
export function updateStationInfo(data) {
  return request({
    url: '/station/stationInfo',
    method: 'put',
    data: data
  })
}
export function changeStationInfoTotal(data) {
  return request({
    url: '/station/stationInfo/changeTotal',
    method: 'put',
    data: data
  })
}

export function updateDeviceRealList(data) {
  return request({
    url: '/station/stationInfo/deviceReal',
    method: 'put',
    data: data
  })
}
export function updateDeviceRealListByType(data) {
  return request({
    url: '/station/stationInfo/deviceRealByType',
    method: 'put',
    data: data
  })
}

export function changeDeviceOnOff(id,onOff) {
  const data = {
    id,
    onOff
  };
  return request({
    url: '/station/stationInfo/deviceReal/onOff',
    method: 'put',
    data: data
  })
}

// 删除能源站信息
export function delStationInfo(stationId) {
  return request({
    url: '/station/stationInfo/' + stationId,
    method: 'delete'
  })
}

//根据站点类型 查询所有正在使用站点
export function selectUseListByStationTypeCode(stationTypeCode) {
  return request({
    url: '/station/stationInfo/list/' + stationTypeCode,
    method: 'get'
  })
}

//获取站点监控数据
export function selectStationMonitor(stationId) {
  return request({
    url: '/station/stationInfo/monitor/' + stationId,
    method: 'get'
  })
}













